package test0ne;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Number1000W {

    public static void main(String[] args) {
    }

    public static void print(int[] array) {
        List<Integer> preList = new ArrayList<>();
        List<Integer> list = new ArrayList<>();
        int min = array[0];
        for (int i = 1; i < array.length; i++) {
            if(array[i]<min) {
                if(list.size()<10) {
                    list.add(array[i]);
                }else{
                    for (Integer integer : list) {
                        preList.add(integer);
                    }
                    Collections.sort(list);
                    min = list.get(0);
                    list.removeAll(list);
                }
            }
        }
        preList.addAll(list);
        Collections.sort(preList);
        for (int i = 0; i < 10; i++) {
            System.out.print(preList.get(i));
        }
    }
}
